.dashboard-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  /* 移除左边距，防止页面左右移动 */
  margin-left: 0;
  /* 修改为淡粉色背景 */
  background-color: #f9f0f5;
  color: #d3e9ff;
  /* 允许内容溢出时滚动，但不隐藏 */
  overflow: auto;
}

/* Sidebar */
.sidebar {
  width: 200px;
  background: linear-gradient(180deg, #1a1a2e 0%, #151525 100%);
  border-right: 1px solid #2a2a3e;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

.sidebar-logo {
  padding: 0 20px 30px;
  border-bottom: 1px solid #2a2a3e;
  margin-bottom: 20px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  color: white;
  margin-bottom: 8px;
}

.logo-text {
  font-size: 14px;
  font-weight: 600;
  color: #d3e9ff;
  letter-spacing: 1px;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  color: #8a8aa8;
}

.nav-item:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #d3e9ff;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.1));
  color: #d3e9ff;
  border-left: 3px solid #667eea;
}

.nav-icon {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.nav-text {
  font-size: 14px;
}

.sidebar-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid #2a2a3e;
  color: #8a8aa8;
}

.footer-dots {
  font-size: 20px;
  cursor: pointer;
}

.footer-icon {
  font-size: 18px;
  cursor: pointer;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  /* 使用百分比padding，使内容自适应 */
  padding: 2%;
  /* 当内容超出时允许垂直滚动 */
  overflow-y: auto;
  /* 水平方向不允许溢出 */
  overflow-x: hidden;
  /* 修改为淡粉色背景 */
  background-color: #f9f0f5;
}

/* Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon {
  font-size: 24px;
}

.header-title {
  font-size: 24px;
  font-weight: 600;
  color: #d3e9ff;
  margin: 0;
  align-self: center; /* 确保标题在flex容器中垂直居中 */
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-time {
  font-size: 18px;
  font-weight: 600;
  color: #5da8ff;
  font-variant-numeric: tabular-nums;
}

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s;
}

.refresh-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.refresh-btn span:first-child {
  font-size: 16px;
}

/* Metrics Row */
.metrics-row {
  display: grid;
  /* 使用repeat和auto-fit实现自适应 */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.metric-card {
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.8) 0%, rgba(21, 21, 37, 0.8) 100%);
  border: 1px solid #2a2a3e;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.metric-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: bold;
  flex-shrink: 0;
}

.metric-icon.green {
  background: linear-gradient(135deg, #2ed573 0%, #1eae57 100%);
  color: white;
}

.metric-content {
  flex: 1;
}

.metric-label {
  font-size: 13px;
  color: #8a8aa8;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 24px;
  font-weight: 600;
  color: #d3e9ff;
  margin-bottom: 4px;
}

.metric-value.positive {
  color: #2ed573;
}

.metric-desc {
  font-size: 12px;
  color: #6a6a8a;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  /* 使用repeat和auto-fit实现自适应 */
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.8) 0%, rgba(21, 21, 37, 0.8) 100%);
  border: 1px solid #2a2a3e;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #2a2a3e;
}

.chart-title {
  font-size: 16px;
  font-weight: 600;
  color: #d3e9ff;
  margin: 0;
}

.chart-filter {
  padding: 6px 12px;
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid #2a2a3e;
  border-radius: 6px;
  color: #d3e9ff;
  font-size: 12px;
  cursor: pointer;
}

.chart-filter:focus {
  outline: none;
  border-color: #667eea;
}

.chart-tabs {
  display: flex;
  gap: 8px;
}

.tab-btn {
  padding: 6px 16px;
  background: transparent;
  border: 1px solid #2a2a3e;
  border-radius: 6px;
  color: #8a8aa8;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.tab-btn:hover {
  border-color: #667eea;
  color: #d3e9ff;
}

.tab-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: white;
}

.chart-content {
  flex: 1;
  min-height: 0;
}

/* Placeholder Cards */
.placeholder-row {
  display: grid;
  /* 使用repeat和auto-fit实现自适应 */
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.placeholder-card {
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.8) 0%, rgba(21, 21, 37, 0.8) 100%);
  border: 1px solid #2a2a3e;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  transition: transform 0.3s;
}

.placeholder-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.placeholder-number {
  font-size: 32px;
  font-weight: bold;
  color: #667eea;
  margin-bottom: 8px;
}

.placeholder-title {
  font-size: 14px;
  color: #8a8aa8;
}

/* Scrollbar Styling */
.main-content::-webkit-scrollbar {
  width: 8px;
}

.main-content::-webkit-scrollbar-track {
  background: #1a1a2e;
}

.main-content::-webkit-scrollbar-thumb {
  background: #2a2a3e;
  border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
  background: #3a3a4e;
}

/* 为主题添加特定样式 */
:root[data-theme="light"] .dashboard-container,
:root[data-theme="light"] .main-content {
  color: #213547;
  background-color: #f9f0f5;
}

:root[data-theme="dark"] .dashboard-container,
:root[data-theme="dark"] .main-content {
  color: #d3e9ff;
  background-color: #f9f0f5;
}

:root[data-theme="white"] .dashboard-container,
:root[data-theme="white"] .main-content {
  color: #000000;
  background-color: #f9f0f5;
}

/* 为主题添加特定的卡片样式 */
:root[data-theme="light"] .metric-card,
:root[data-theme="light"] .chart-card,
:root[data-theme="light"] .placeholder-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #e0e0e0;
  color: #213547;
}

:root[data-theme="white"] .metric-card,
:root[data-theme="white"] .chart-card,
:root[data-theme="white"] .placeholder-card {
  background: rgba(255, 255, 255, 1);
  border: 1px solid #cccccc;
  color: #000000;
}

:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .chart-card,
:root[data-theme="dark"] .placeholder-card {
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.8) 0%, rgba(21, 21, 37, 0.8) 100%);
  border: 1px solid #2a2a3e;
  color: #d3e9ff;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 10px;
  }
  
  .metrics-row,
  .placeholder-row {
    grid-template-columns: 1fr;
  }
  
  .dashboard-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
  
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
}
